package Work3;

import java.util.Scanner;



 public class Pro2 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String name;
		int age;
		boolean sex;
		int n = in.nextInt();
		Person a[] = new Person[n];
		for (int i = 0; i < n; i++) {
		    name = in.next();
		    age = in.nextInt();
		    sex = in.nextBoolean();
			a[i] = new  Person(name,age,sex);
		}
		for(int j = n-1; j >=0 ;j--)
			System.out.println(a[j]);
		
	    System.out.println(new Person());
	}
   
}

class  Person{
	private String name;
	private boolean gender;
	private int age;
	private int id;
	static int idm;
	static {
		System.out.println("This is static initializtion block");
	}
	
	{
		this.id = idm;
		System.out.println("This is initializtion block, id is " + this.id);
		idm++;                      
	}
	Person(){
		System.out.println("This is constructor");
		System.out.println(name +"," + age +"," +
							gender + "," + id);
	}
	Person(String name,int age,boolean gender){
		this.name = name;
		this.gender = gender;
		this.age = age;
	}

	@Override
	public String toString() {
		return "Person [name=" + this.name + ", age="
				+ this.age + ", gender=" +this.gender +
				", id=" + this.id +"]";
		
	}
}